/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package thienphuc.patient.bo.impl;

import java.util.List;
import thienphuc.patient.bo.DichVuLamSanBO;
import thienphuc.patient.dao.DichVuLamSanDAO;
import thienphuc.patient.dao.impl.DichVuLamSanDAOImpl;
import thienphuc.patient.dto.BenhAn;
import thienphuc.patient.dto.DichVuLamSan;

/**
 *
 * @author QuocDat
 */
public class DichVuLamSanBOImpl implements DichVuLamSanBO {

    private DichVuLamSanDAO dichVuLamSanDAO;

    public DichVuLamSanBOImpl() {
        this.dichVuLamSanDAO = new DichVuLamSanDAOImpl(DichVuLamSan.class);
    }
    
    public DichVuLamSan getById(int maLamSan) throws Exception {
        return this.dichVuLamSanDAO.findById(maLamSan);
    }

    public List<DichVuLamSan> getByBenhAn(BenhAn benhAn) throws Exception {
        return this.dichVuLamSanDAO.findByBenhAn(benhAn);
    }

    public boolean insertDichVuLamSan(DichVuLamSan dichVuLamSan) throws Exception {
        return this.dichVuLamSanDAO.save(dichVuLamSan);
    }

    public boolean udpateDichVuLamSan(DichVuLamSan dichVuLamSan) throws Exception {
        return this.dichVuLamSanDAO.update(dichVuLamSan);
    }
    
}
